import request from '@/utils/request'

export function getHouseHoldList(params) {
  return request({ // 查询住户列表
    url: '/PMSystem/t-household',
    method: 'get',
    params
  })
}

export function deleteById(id) { // 根据id删除用户
  return request({
    url: `/PMSystem/t-household/${id}`,
    method: 'delete'
  })
}

export function addHouseHold(params) { // 新增用户
  return request({
    url: '/PMSystem/t-household',
    method: 'post',
    data: params
  })
}

export function deletePatch(ids) { // 根据id批量删除小区
  return request({
    url: '/PMSystem/t-household',
    method: 'delete',
    data: ids
  })
}

export function editById(id, body) { // 根据id编辑小区信息
  return request({
    url: `/PMSystem/t-household/${id}`,
    method: 'put',
    data: body
  })
}

export function getWorks() { // 获取维修工人
  return request({
    url: '/PMSystem/t-household/repairWorker',
    method: 'get'
  })
}

export function fenpeiWorker(repairId, userId) { // 为维修单分配工人
  return request({
    url: '/PMSystem/t-handler-repair',
    method: 'post',
    data: {
      repairId: repairId,
      handlerId: userId
    }
  })
}
